package com.xiyue.leaspring.task.annotation;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class MyTask1 {

	@Scheduled(fixedRate = 1000)
	public void runTaskFixedRate() {
		System.out.println(Thread.currentThread().getName()+"===fixedRate==="+System.currentTimeMillis());
	}
	
	@Scheduled(cron = "* * * * * ?")
	public void runTaskCron() {
		System.out.println(Thread.currentThread().getName()+"===cron==="+System.currentTimeMillis());
	}
}
